package com.opengw.configuration.publish;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@javax.persistence.TableGenerator(
	    name="publish_id_generator",
	    table="publish_id_generator",
	    pkColumnName = "publish_id",
	    valueColumnName = "publish_id_val",
	    pkColumnValue="key",
	    allocationSize=20
	)
@Entity
@Table(name = "publish_base")
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class BasePublish implements Serializable {

	private static final long serialVersionUID = 7736823173169533221L;
	private long publish_id;
	protected String publishName;

	public void setPublishName(String publishName) {
		this.publishName = publishName;
	}

	@Column(name = "publish_name")
	public String getPublishName() {
		return publishName;
	}

	public void setPublish_id(long publish_id) {
		this.publish_id = publish_id;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "publish_id_generator")
	@Column(name = "publish_id")
	public long getPublish_id() {
		return publish_id;
	}

}
